import React, { Component } from 'react'
import PropTypes from "prop-types"
import './index.css'
class Myfooter extends Component {
    static propTypes = {
        items: PropTypes.array.isRequired,
        delAlled :PropTypes.func.isRequired
    }
    delAlled = ()=>{
        this.props.delAlled()
    }
    render() {
        let {items} = this.props
        return (<div className="footer-container">
            <div>已经完成{items.filter(item=>item.checked).length}个，剩余{items.filter(item=>!item.checked).length}个</div>
            <div className="btn" onClick="delAlled">删除已完成任务</div>
        </div>)
    }
}

export default Myfooter